﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _3.Person
{
    class Program
    {
        static void Main(string[] args)
        {
            Person p = new Person();

            p.FirstNameChanged += new EventHandler(p_FirstNameChanged);

            p.FirstName = "pesho";
            p.FirstName = "pesho";
            p.FirstName = "pencho";
        }

        static void p_FirstNameChanged(object sender, EventArgs e)
        {
            Person p = sender as Person;

            Console.WriteLine("FirstName of the person has just changed to {0}", p.FirstName);
        }
    }
}
